# -*- encoding: utf-8 -*- 
'''
@Author  :   billfun 
@Software:   PyCharm 
@File    :   cal_bill_action.py
@Time    :   2018/1/23 23:46 
@Desc    :   calBillUI的业务逻辑类，calBillUI是界面类，保证界面和业务逻辑的分离
'''

from PyQt5.QtCore import pyqtSlot
from PyQt5.QtWidgets import QMainWindow
from qtUI import cal_bill_ui


class actionForm (QMainWindow):
    def __init__(self,parent=None):
        super(actionForm,self).__init__(parent)
        self.ui = cal_bill_ui.Ui_MainWindow()
        self.ui.setupUi(self)
        self.cnt_i=0

    def getCBcurTxt(self,qcb):
        #qcb is  QComboBox
        return qcb.currentText()

    @pyqtSlot()
    def on_genButton_clicked(self):
        if type(self.ui.monCB) == "<class 'PyQt5.QtWidgets.QComboBox'>":
            print("aaaaaaaaaaaa"+type(self.ui.monCB).__name__)
        else:
            print("bbbbbbbbbbbb"+type(self.ui.monCB).__name__)

        self.ui.outPutTB.append('当前选择月份：'+self.getCBcurTxt(self.ui.monCB))
        print(type(self.ui.calTypeCB))
        print(str(type(self.ui.calTypeCB)))

        self.ui.outPutTB.append('当前选择计算类型：' + self.getCBcurTxt(self.ui.calTypeCB))
